home *** CD-ROM | disk | FTP | other *** search
/ Greatest Childrens Stories Ever Told / Greatest_Stories.iso / demos / funtown / demo.dir / 00046_Script_Scripts 1 < prev    next >
Text File  |  1994-11-08  |  5KB  |  171 lines

  1. --òòò Scripts 1
  2. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  3. on startMovieMacro backDrops
  4.   global mode, mode.1, HS, QL, MS
  5.   if HS then doMike
  6.   else
  7.     cursor 4
  8.     correctInterface
  9.     set QL=""
  10.     setGlobalVariables
  11.     setCurrentView
  12.     set the timeOutScript to "unloadCast"
  13.     if not ( mode ) then set mode=1
  14.     set mode.1= ( mode<>integer ( mode ))
  15.     set mode=integer ( mode )
  16.     initTracking
  17.     cursor -1
  18.   end if
  19. end
  20. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  21. on setGlobalVariables
  22.   installMenu 0
  23.   global ML, WT, mode, MS, CV, WC, CIU, MIU, NM, M, H, V
  24.   set ML="Explore,Learn,Find,Match,Read,TreasureHunt,SuperTreasureHunt,What'sMissing,What'sDifferent,PictureDictionary"
  25.   set WT="0022c880,10334c81,200044c2,2330556c,c4400066,8c455077,88c66000,112c6770,12345678"
  26.   set MS=item (mode) of ML
  27.   set CV="0"
  28.   set WC=9000
  29.   set CIU=0
  30.   set MIU=0
  31.   set NM="0"
  32.   set M=the movie
  33.   set H=-18
  34.   set V=-13
  35. end
  36. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  37. on setCurrentView
  38.   global CV, mode, MS
  39.   if the frame>=marker("map") then set CV="0"
  40.   else if the frame>=marker("posc1") then set CV="c"
  41.   else if the frame>=marker("pos81") then set CV="8"
  42.   else if the frame>=marker("pos71") then set CV="7"
  43.   else if the frame>=marker("pos61") then set CV="6"
  44.   else if the frame>=marker("pos51") then set CV="5"
  45.   else if the frame>=marker("pos41") then set CV="4"
  46.   else if the frame>=marker("pos31") then set CV="3"
  47.   else if the frame>=marker("pos21") then set CV="2"
  48.   else if the frame>=marker("pos11") then set CV="1"
  49.   else set CV = "0"
  50.   when keyDown then checkKeyEvent the key, charToNum ( the key )
  51.   randomizeQuestions 5
  52.   reposition (CV)
  53.   pointerCursor
  54. end
  55. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  56. on checkKeyEvent whichKey, whichKeyCode
  57.   if the commandDown then exit
  58.   global mode, MS
  59.   if whichKey="?" or whichKey="/" then 
  60.     doHelp
  61.   else if whichKeyCode=29 then 
  62.     doArrow 4 
  63.   else if whichKeyCode=28 then 
  64.     doArrow 8
  65.   else if whichKeyCode=30 then 
  66.     doArrow 2 
  67.   else if whichKeyCode=31 then 
  68.     doArrow 6
  69.   else if whichKeyCode=27 then
  70.     doBell 
  71.     UnCoverDesktop
  72.     quit
  73.   else if whichKey="Q" then
  74.     if the commandDown then
  75.       doBell 
  76.       UnCoverDesktop
  77.       quit
  78.     end if
  79.   else if whichKey="S" then 
  80.     set the soundenabled=not ( the soundenabled )
  81.   else if whichKey>="0" and whichKey<="9" then
  82.     set the soundenabled=1
  83.     set the soundLevel=( value ( whichKey )) * 28 
  84.   else if whichKeyCode=160 then
  85.     doTime
  86.     dontPassEvent
  87.   end if
  88. end
  89. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  90. on UnCoverDesktop
  91.   global rwObj
  92.   if objectP( rwObj ) then rwObj( mDispose )
  93.   unload
  94. end UnCoverDesktop
  95. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  96. on showTime
  97.   exitTracking
  98.   put the result
  99.   return the result
  100. end
  101. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  102. on doTime manual
  103.   set filePath = "Around the House:Movies:Time Sounds:"
  104.   if length(string(manual)) then set theTime=manual
  105.   else set theTime=the time
  106.   set colon=offset (":",theTime)
  107.   set hour=value(char 1 to colon-1 of theTime)
  108.   if hour>12 then set hour=hour-12
  109.   set min=value(char colon+1 to colon+2 of theTime)
  110.   put hour && min 
  111.   if min=0 then playTime filePath, hour& ",o'clock"
  112.   else if min=15 then playTime filePath, "quarter-past,"& hour
  113.   else if min=30 then playTime filePath, "half-past,"& hour
  114.   else if min=45 and hour<12 then playTime filePath, "quarter-of,"& hour+1
  115.   else if min=45 and hour=12 then playTime filePath, "quarter-of,"& 1
  116.   else
  117.     set whichSounds=hour& ","
  118.     if min<10 then set whichSounds=whichSounds& "0," 
  119.     if min<21 then set whichSounds=whichSounds& min 
  120.     else
  121.       set tenMin=(min/10*10)
  122.       set whichSounds=whichSounds& string(tenMin)& ","
  123.       if not(min=tenMin) then set whichSounds=whichSounds& (min-tenMin)
  124.     end if
  125.     put whichsounds
  126.     playTime filePath, whichSounds
  127.   end if
  128. end doTime
  129.  
  130. on loopsound
  131.   REPEAT WHILE SOUNDBUSY(1)
  132.   END REPEAT
  133.   EXIT
  134. end
  135.  
  136. on playTime newPathName, whichSounds
  137.   repeat with x=1 to the number of items in whichSounds
  138.     put newpathname&(item x of whichsounds)  
  139.     sound playFile 1,  "Around the Town:Sounds:"&newName&value(item x of whichsounds) 
  140.     updateStage
  141.     repeat while the soundBusy of 1
  142.       updateStage
  143.     end repeat
  144.   end repeat
  145. end playTime
  146. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  147. on CorrectInterface
  148.   global mode, CV
  149.   if mode = 2 then exit  
  150.   activate 48, the number of Cast "Skip",1,8,192,363,"","",""
  151.   updateStage
  152. end 
  153. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  154. on doMike
  155.   global mode, HS, DL, QL, QA, MS
  156.   cursor 4
  157.   set HS = false
  158.   if mode > 2 then activate 48, the number of Cast "Skip",1,8,192,363,"","",""
  159.   when keyDown then checkKeyEvent the key, charToNum ( the key )
  160.   reposition ( CV)
  161.   if mode = 2 then
  162.     puppetSprite 36, true
  163.     set the CastNum of Sprite 36 = the number of Cast MS
  164.     updateStage
  165.   end if
  166.   cursor -1
  167. end
  168.  
  169.  
  170.  
  171.